package com.zqz.webserver.herocat;

import com.zqz.webserver.servlet.HeroRequest;
import com.zqz.webserver.servlet.HeroResponse;
import com.zqz.webserver.servlet.HeroServlet;

public class DefaultCustomServlet extends HeroServlet {

    @Override
    public void doGet(HeroRequest request, HeroResponse response) throws Exception {
        response.write("404 not found:" +
                (request.getUri().contains("?") ? request.getUri().substring(0, request.getUri().lastIndexOf("?")) : request.getUri())
        );
    }

    @Override
    public void doPost(HeroRequest request, HeroResponse response) throws Exception {
        this.doGet(request, response);
    }
}
